import uvicorn
from fastapi import FastAPI
from buss.eq import eq, Eq_model
from buss.calc import calc, Calc_model
from buss.pyShell import pyShell, Pyshell_model
from buss.spider import chinafcd, Food_model
from buss.lunar import is_lunar, lunar_filter, cur_lunar, Is_lunar_model, Lunar_filter_model
from buss.cube.RubikCube.rubik import rubik, RubikCube_model

app= FastAPI()

@app.post('/eq_calc')
def eq_calc(model: Eq_model):
    return eq(model)

@app.post('/calc_calc')
def int_calc(model: Calc_model):
    return calc(model)

@app.post('/pyshell')
def pyshell(model: Pyshell_model):
    return pyShell(model)

@app.post('/food')
def food(model: Food_model):
    return chinafcd(model)

@app.post('/is_lunar')
def isLunar(model: Is_lunar_model):
    return is_lunar(model)

@app.post('/lunar_filter')
def lunarFilter(model: Lunar_filter_model):
    return lunar_filter(model)

@app.get('/cur_lunar')
def curLunar():
    return cur_lunar()

@app.post('/rubik_cube')
def rubikCube(model: RubikCube_model):
    return rubik(model)

if __name__ == "__main__":
    uvicorn.run(app=app, host="0.0.0.0", port=8000)

